import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class test {

    public static void main(String[] args) {
        String test = "学号=9\t总分数=119\t名字vxrjx\t排名10\tchinese\t:27\tphysics\t:9\tenglish\t:63\tmath\t:20\t";
        String re1 = "学号=([0-9]*[0-9])\\.*";
        String re2 = "名字([\\w]{1,20})\\.*";
        String[] t = {"math", "chinese", "english"};
        Map<String, String> res = new HashMap<>();
        res.put("学号", re1);
        res.put("名字", re2);
        ArrayList<Integer> list = new ArrayList<>();
        String re = "chinese" + "\\s:" + "([0-9]*[0-9])\\.*";
        for (String s : t) {
            String tempRe = s + "\\s:" + "([0-9]*[0-9])\\.*";
            Pattern r = Pattern.compile(tempRe);
            Matcher m = r.matcher(test);
            if (m.find()) {
                System.out.println("Found value: " + m.group(0));
                System.out.println("Found value: " + m.group(1));
                list.add(Integer.parseInt(m.group(1)));
            } else {
                list.add(-1);
            }
        }
        System.out.println(list);
    }



}
